<?php
include('controller/connect.php');
dbClass::connect();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="images/fav.ico">
<link rel="icon" type="image/gif" href="images/fav.ico">
<title>Gallery | <? dbClass::titlePage(); ?></title>
<script type="text/javascript" src="javascripts/jquery.min.js"></script>
<script type="text/javascript" src="javascripts/jquery.lightbox-0.5.pack.js"></script>
<script type="text/javascript" src="javascripts/script.js"> </script>


	<link rel="stylesheet" href="css/style2.css" type="text/css" charset="utf-8" />
    <link rel="stylesheet" href="css/front.css" type="text/css" charset="utf-8" />
       <link rel="stylesheet" href="css/demo.css" type="text/css" charset="utf-8" />
      <link rel="stylesheet" href="css/demo1.css" type="text/css" charset="utf-8" />
       <link rel="stylesheet" href="css/jquery.lightbox-0.5.css" type="text/css" charset="utf-8" />
</head>
<body>
<!-- For the f**kn LOgin-->
<div id="con">
  <div id="topnav" class="topnav"><a href="login_r.php" class="signin"><span>Sign in</span></a> </div>
 

  <fieldset id="signin_menu">
    <form method="post" id="login" action="view/main.php">
      <label for="username">Username or email</label>
      <input id="emailusername" name="emailusername" value="" title="emailusername" tabindex="4" type="text">
      </p>
      <p>
        <label for="password">Password</label>
        <input id="password" name="password" value="" title="password" tabindex="5" type="password">
      </p>
      <p class="remember">
        <input id="signin_submit" value="Login" tabindex="6" type="submit">
        <input id="remember" name="remember_me" value="1" tabindex="7" type="checkbox">
        <label for="remember">Remember me</label>
      </p>
      <p class="forgot"> <a href="#" id="resend_password_link">Forgot your password?</a> </p>
      <p class="forgot-username"> <A id=forgot_username_link 
title="If you remember your password, try logging in with your email" 
href="#">Forgot your username?</A> </p>
    </form>
  </fieldset>
</div>

<div id="page">
<div id="wrapper">
        		   <div class="header_top" id="header_top"> </div>
     </div>
               <div class="header2"></div> 
	<div class="header"><!--open logo --></div><!--end header -->
	<!-- close logo-->
<!-- hide the client inquiries php-->
    <?php
    echo '<div id="nav">';
    echo '<div class="underlinemenu">';
	include('view/menu.php');
	echo '</div>';
    echo '</div>';
	?>
   
       <div id="body"> <!--open body -->
  
      
      <div id="content_cen"> 
     
          <h2>Gallery</h2>

<div id="gallery">     		
<?php

$directory = 'view/upload';
$allowed_types=array('jpg','jpeg','gif','png');
$file_parts=array();
$ext='';
$title='';
$i=0;

$dir_handle = @opendir($directory) or die("There is an error with your image directory!");

while ($file = readdir($dir_handle)) 
{
	if($file=='.' || $file == '..') continue;
	
	$file_parts = explode('.',$file);
	$ext = strtolower(array_pop($file_parts));

	$title = implode('.',$file_parts);
	$title = htmlspecialchars($title);
	
	$nomargin='';
	
	if(in_array($ext,$allowed_types))
	{
	
		if(($i+1)%4==0) $nomargin='nomargin';
		echo '
		<div class="pic '.$nomargin.'" style="background:url('.$directory.'/'.$file.') no-repeat 50% 50%;">
		<a href="'.$directory.'/'.$file.'" title="'.$title.'" target="_blank"></a><p>'.$title.'</p></div>';

	$i++;
	}
}

closedir($dir_handle);

?>
</div>
    	</div> <!--close right-->
      <div class="clear">&nbsp;</div>
 <!-- footer-->
 <?php 
	  echo '<div id="footer">';
     include('view/footer.php');
      echo '</div>';
	  ?>

    </div><!-- close body-->
</div><!-- close page-->


</body>
</html>

<!--JAVASCRIPT PART-->

<script type="text/javascript">
        $(document).ready(function() {
								   
	$('.pic a').lightBox({
		
		imageLoading: 'javascripts/images/loading.gif',
		imageBtnClose: 'javascripts/images/close.gif',
		imageBtnPrev: 'javascripts/images/prev.gif',
		imageBtnNext: 'javascripts/images/next.gif'

			});			
			
        });
</script>
<script src="javascripts/jquery.tipsy.js" type="text/javascript"></script>
<script type='text/javascript'>
    $(function() {
	  $('#forgot_username_link').tipsy({gravity: 'w'});   
    });
  </script>

	


	

